/**
 * el-date-picker 禁止选择之前的日期
 */

/**
 * 日期
 * @param time
 * @returns {boolean}
 */
export const disabledDate = time => {
  return time.getTime() < Date.now() - 8.64e7;
};
/**
 * 小时
 * @returns {*[]}
 */
export const disabledHour = () => {
  let hours = [];
  for (let i = 0; i < 24; i++) {
    if (new Date().getHours() <= i) continue;
    hours.push(i);
  }
  return hours;
};
/**
 * 分钟
 * @returns {*[]}
 */
export const disabledMinute = () => {
  const minutes = [];
  for (let i = 0; i < 60; i++) {
    if (new Date().getMinutes() <= i) continue;
    minutes.push(i);
  }
  return minutes;
};
/**
 * 秒
 * @returns {*[]}
 */
export const disabledSecond = () => {
  const second = [];
  for (let i = 0; i < 60; i++) {
    if (new Date().getSeconds() <= i) continue;
    second.push(i);
  }
  return second;
};
